#ifndef LINKVIEW_H
#define LINKVIEW_H

#include <QObject>
#include <QGraphicsView>
#include<memory>
#include<algorithm>
#include<string.h>
#include<QUndoStack>

using namespace std;

class Node{
public:
    int val, ind;
    Node *next=NULL;
};

class LinkView : public QGraphicsView
{
    Q_OBJECT
public:
    QUndoStack stack;
    explicit LinkView(QWidget *parent = nullptr);
    bool add(int ind, int num);
    bool del(int ind, int num);
    void paint();
signals:

private:
    Node *list;
    QGraphicsScene *scene;
};

#endif // LINKVIEW_H
